package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.MstnProjectConditionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.system.domain.MstnProject;
import com.ruoyi.system.mapper.MstnProjectMapper;
import com.ruoyi.system.domain.MstnProjectCondition;
import com.ruoyi.system.service.IMstnProjectService;

/**
 * 项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-18
 */
@Service
public class MstnProjectServiceImpl implements IMstnProjectService 
{
    @Autowired
    private MstnProjectMapper mstnProjectMapper;

    @Autowired
    private MstnProjectConditionMapper mstnProjectConditionMapper;

    /**
     * 查询项目
     * 
     * @param projectId 项目主键
     * @return 项目
     */
    @Override
    public MstnProject selectMstnProjectByProjectId(Long projectId)
    {
        return mstnProjectMapper.selectMstnProjectByProjectId(projectId);
    }

    /**
     * 查询项目列表
     * 
     * @param mstnProject 项目
     * @return 项目
     */
    @Override
    public List<MstnProject> selectMstnProjectList(MstnProject mstnProject)
    {
        return mstnProjectMapper.selectMstnProjectList(mstnProject);
    }

    /**
     * 新增项目
     * 
     * @param mstnProject 项目
     * @return 结果
     */
    @Override
    public int insertMstnProject(MstnProject mstnProject)
    {
        mstnProject.setCreateTime(DateUtils.getNowDate());
        return mstnProjectMapper.insertMstnProject(mstnProject);
    }

    /**
     * 修改项目
     * 
     * @param mstnProject 项目
     * @return 结果
     */
    @Transactional
    @Override
    public int updateMstnProject(MstnProject mstnProject)
    {
        mstnProject.setUpdateTime(DateUtils.getNowDate());
        return mstnProjectMapper.updateMstnProject(mstnProject);
    }

    /**
     * 批量删除项目
     * 
     * @param projectIds 需要删除的项目主键
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteMstnProjectByProjectIds(Long[] projectIds)
    {
        return mstnProjectMapper.deleteMstnProjectByProjectIds(projectIds);
    }



}
